﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MQ.Core.Common;
using MQ.Core.IService.System;
using MQ.Core.Admin.Filters;

namespace MQ.Core.Admin.Areas.System.Controllers
{
    /// <summary>
    /// 用户
    /// </summary>
    [Route("api/system/[controller]")]
    public class UserController : ApiController
    {
        private IUserService userService;
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="userService"></param>
        public UserController(IUserService userService)
        {
            this.userService = userService;
        }
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pagination"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("page")]
        public object GetPageList([FromQuery]Pagination pagination, [FromQuery]string query)
        {
            var data = userService.GetPageList(pagination, query);
            return Success(pagination,data);
        }
        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="pagination"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpGet]
        public object Get([FromQuery]Pagination pagination, [FromQuery]string query)
        {
            return Success("");
        }
    }
}